package top.ninwoo.cloudcenter.service;

import top.ninwoo.common.entity.ClusterConfig;
import top.ninwoo.common.entity.ContainerMonitorInfo;
import top.ninwoo.common.entity.NetworkTopology;
import top.ninwoo.common.entity.SeparatedClusterConfig;

import java.util.List;
import java.util.Set;

/**
 * 云端的服务接口
 */
public interface CloudService {
    String initCluster(ClusterConfig clusterConfig);

    Set<String> getIpListFromRemoteIpServiceByAppName(long clusterId, String appName);

    List<SeparatedClusterConfig> sendClusterConfigToEdgeNode(List<SeparatedClusterConfig> clusterConfigs);

    List<SeparatedClusterConfig> sendClusterConfigToEdgeNodeByThreads(List<SeparatedClusterConfig> clusterConfigs);

    boolean deleteClusterFromEdgeNode(long clusterId);

    void updateLogicalTopology(long clusterId, NetworkTopology topology);

    NetworkTopology getLogicalNetworkByClusterId(Long clusterId);

    String enableNetworkMonitor(Long clusterId, String appName);

    List<ContainerMonitorInfo> getContainerMonitorInfoByAppName(Long clusterId, String appName);

    String cancelNetworkMonitor(Long clusterId, String appName);

    List<String> getEdgeNodeIds();

    Boolean addQos(Long clusterId, String appName, String maxRate, String latency);

    boolean adjustCluster(List<SeparatedClusterConfig> clusterConfigs);

    boolean sendLogicTopo(List<SeparatedClusterConfig> clusterConfigs);

    boolean adjustLogicTopo(List<SeparatedClusterConfig> clusterConfigs);
}
